package com.jic.member.controller.rest;

import com.jic.common.base.vo.RestResult;
import com.jic.member.sms.GenerateSmsContent;
import com.jic.member.sms.SmsSendRequest;
import com.jic.member.sms.SmsVerifyRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/sms/internal")
@Api(tags = "短信发送校验")
public class SmsController {
    @Autowired
    private GenerateSmsContent smsContent;

    @ApiOperation(value = "发送短信")
    @PostMapping("/send/sms")
    @ResponseBody
    public RestResult sendSms(@RequestBody SmsSendRequest smsSendRequest) throws Throwable {
        return smsContent.sendSms(smsSendRequest);
    }

    @ApiOperation(value = "短信OTP验证")
    @PostMapping("/verify/otp")
    public RestResult verify(@RequestBody SmsVerifyRequest smsVerifyRequest) throws Throwable {
        return smsContent.verify(smsVerifyRequest);
    }
}
